package org.jeecg.chase.common.supper.process;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

/**
 * @author leikai
 * @version 1.0
 * @description:
 * @date 2021/08/05/0005 10:45
 */
@Configuration
public class CommonProcessInitService implements Ordered, ApplicationContextAware {

    private ApplicationContext applicationContext;

    @Override
    public int getOrder() {
        //最后一个执行
        return Integer.MAX_VALUE;
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
        CommonProcessBuilder.buidCommonProcess(this.applicationContext);
    }
}
